<div class="ibox-title">{:lang('修改收支记录')}</div>
<div class="ibox-content auto-height-box">
    <form class="form-horizontal" method="post" action="{:url('bookkeep.BkTransaction/edit')}" >
        <input type="hidden" name="id" value="{$info.id|default='0'}">
        <input type="hidden" name="type" value="{$info.type|default='1'}"/>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('金额')}</label>
            <div class="col-sm-8">
                <input name="amount" class="form-control" type="text" value="{$info.amount*$info.type}"/>
                <span class="help-block m-b-none"></span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('分类')}</label>
            <div class="col-sm-8">
                <div class="suggest-search-box">
                    <div class="input-group category-suggest">
                        <input type="hidden" name="category_id" value="{$info.category_id|default=''}">
                        <input type="text" name="category_name"
                               value="{$info.category_name|default=''}"
                               class="form-control suggest-input" placeholder="{:lang('选择分类')}"
                               data-url="{:url('Comm/suggest_search',array('datatype'=>'category'))}"
                               searchFields="keywords"
                               target-group="category-suggest"
                               target-name='{"category_id":"id","category_name":"name"}'
                               source-group="form-horizontal"
                               source-name='{"type":"{:lang("类型")}"}'
                        >
                        <div class="input-group-btn">
                            <button type="button" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </div>
                <span class="help-block m-b-none"></span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('时间')}</label>
            <div class="col-sm-8">
                <input type="text" name="transaction_date" class="form-control datepicker"
                       value="{$info.transaction_date|default=''|format_time='Y-m-d'}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('账户')}</label>
            <div class="col-sm-8">
                <div class="suggest-search-box">
                    <div class="input-group account-suggest">
                        <input type="hidden" name="account_id" value="{$info.account_id|default=''}">
                        <input type="text" name="account_name"
                               value="{$info.account_name|default=''}"
                               class="form-control suggest-input" placeholder="{:lang('选择账户')}"
                               data-url="{:url('Comm/suggest_search',array('datatype'=>'account','type'=>'-1'))}"
                               searchFields="keywords"
                               target-group="account-suggest"
                               target-name='{"account_id":"id","account_name":"name"}'>
                        <div class="input-group-btn">
                            <button type="button" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </div>
                <span class="help-block m-b-none"></span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('成员')}</label>
            <div class="col-sm-8">
                <div class="suggest-search-box">
                    <div class="input-group person-suggest">
                        <input type="hidden" name="person_id" value="{$info.person_id|default=''}">
                        <input type="text" name="person_name" value="{$info.person_name|default=''}"
                               class="form-control suggest-input" placeholder="{:lang('选择成员')}"
                               data-url="{:url('Comm/suggest_search',array('datatype'=>'person','type'=>'-1'))}"
                               searchFields="keywords"
                               target-group="person-suggest"
                               target-name='{"person_id":"id","person_name":"name"}'>
                        <div class="input-group-btn">
                            <button type="button" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </div>
                <span class="help-block m-b-none"></span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('商家')}</label>
            <div class="col-sm-8">
                <div class="suggest-search-box">
                    <div class="input-group shop-suggest">
                        <input type="hidden" name="shop_id" value="{$info.shop_id|default=''}">
                        <input type="text" name="shop_name" value="{$info.shop_name|default=''}"
                               class="form-control suggest-input" placeholder="{:lang('选择商家')}"
                               data-url="{:url('Comm/suggest_search',array('datatype'=>'shop','type'=>'-1'))}"
                               searchFields="keywords"
                               target-group="shop-suggest"
                               target-name='{"shop_id":"id","shop_name":"name"}'>
                        <div class="input-group-btn">
                            <button type="button" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('项目')}</label>
            <div class="col-sm-8">
                <div class="suggest-search-box">
                    <div class="input-group project-suggest">
                        <input type="hidden" name="project_id" value="{$info.project_id|default=''}">
                        <input type="text" name="project_name"
                               value="{$info.project_name|default=''}"
                               class="form-control suggest-input" placeholder="{:lang('选择项目')}"
                               data-url="{:url('Comm/suggest_search',array('datatype'=>'project','type'=>'-1'))}"
                               searchFields="keywords"
                               target-group="project-suggest"
                               target-name='{"project_id":"id","project_name":"name"}'>
                        <div class="input-group-btn">
                            <button type="button" class="btn btn-default dropdown-toggle"
                                    data-toggle="dropdown">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu dropdown-menu-right" role="menu"></ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">{:lang('备注')}</label>
            <div class="col-sm-8">
                <input type="text" name="remark" class="form-control" value="{$info.remark}">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-8">
                <button  type="submit" class="btn btn-info no-repeat-button ajax-post"
                         data-style="slide-up" target-form="form-horizontal"
                         data-loading-text="Loading...">
                    <span class="ladda-label"><i class="fa fa-send"></i> {:lang('确定')} </span>
                </button>
            </div>
        </div>
    </form>
</div>

{include file="bookkeep/_bk_transaction/fun"}